Validate arguments
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 26 Jan 2021 12:56:32 +0000 (12:56 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 26 Jan 2021 12:56:32 +0000 (12:56 +0000)
We're just assuming everything is not NULL or with a valid type.

gdk/gdksurface.c

index aaeb6d21b4299e046ef380c595cf55e46736d0f2..31c5b44b73215e4317487b21ec66c1f17d7a83d4 100644 (file)
@@ -2984,6 +2984,11 @@ gdk_surface_translate_coordinates (GdkSurface *from,
   int x1, y1, x2, y2;
   GdkSurface *f, *t;
 
+  g_return_val_if_fail (GDK_IS_SURFACE (from), FALSE);
+  g_return_val_if_fail (GDK_IS_SURFACE (to), FALSE);
+  g_return_val_if_fail (x != NULL, FALSE);
+  g_return_val_if_fail (y != NULL, FALSE);
+
   in_x = *x;
   in_y = *y;